#!/usr/bin/env python3

import rospy
from DrEmpower_can.msg import set_pid
# import DrEmpower as dr

def callback(data):
    import DrEmpower as dr
    dr.set_pid(id_num=data.id_num,P=data.P, I=data.I, D=data.D)
    rospy.loginfo("set_pid_node")


def listener():
    rospy.init_node("set_pid", anonymous=True)
    rospy.Subscriber("set_pid", set_pid, callback)
    rospy.spin()


if __name__ == '__main__':
    listener()

